﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using System.Data.Common;

using Microsoft.Practices.EnterpriseLibrary.Data;

using Husb.Data;
using Husb.DataUtil;

using GroundWater.Data;
using SectionPlaneTable = GroundWater.Data.InfoDataSet.SectionPlaneDataTable;
using SectionPlaneRow = GroundWater.Data.InfoDataSet.SectionPlaneRow;

namespace GroundWater.DataAccess
{
    public class SectionPlaneAdapter : DataAccessAdapter<InfoDataSet, SectionPlaneTable, SectionPlaneRow>
    {

        public SectionPlaneAdapter()
        {
            this.TableName = "SectionPlane";

            GetAllStoredProc = SqlStatements.SectionPlane_FetchAll;
            InsertStoredProc = SqlStatements.SectionPlane_Insert;
            UpdateStoredProc = SqlStatements.SectionPlane_Update;
            DeleteStoredProc = SqlStatements.SectionPlane_Delete;

            GetByIdStoredProc = SqlStatements.SectionPlane_FetchById;
        }


        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            //throw new NotImplementedException();
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "Code", DbType.String, "Code", DataRowVersion.Current);
            db.AddInParameter(cmd, "Name", DbType.String, "Name", DataRowVersion.Current);
            db.AddInParameter(cmd, "QueryCode", DbType.String, "QueryCode", DataRowVersion.Current);
            db.AddInParameter(cmd, "Description", DbType.String, "Description", DataRowVersion.Current);
        }
    }
}
